Ralph Shnelvar
2010-Jul-19 18:06 UTC
[fxruby-users] A way to record the splitter positions
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>A way to record the splitter
positions</title>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Style-Type"
content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal text */
{
font-size: 9pt;
font-family: ''Courier New'';
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* Heading */
{
font-size: 10pt;
font-family: ''Arial'';
font-weight: bold;
color: #0000ff;
}
span.rvts2 /* Subheading */
{
font-size: 10pt;
font-family: ''Arial'';
font-weight: bold;
color: #000080;
}
span.rvts3 /* Keywords */
{
font-size: 10pt;
font-family: ''Arial'';
font-style: italic;
color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
font-size: 10pt;
font-family: ''Arial'';
color: #008000;
text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
font-size: 10pt;
font-family: ''Arial'';
color: #008000;
text-decoration: underline;
}
span.rvts6
{
font-size: 8pt;
font-family: ''arial'';
font-style: italic;
color: #c0c0c0;
}
a.rvts7, span.rvts7
{
font-size: 8pt;
font-family: ''arial'';
color: #0000ff;
text-decoration: underline;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
--></style>
</head>
<body>
<p>Is there a generic way of recording the splitter position(s) and
throwing them at the registry?</p>
</body></html>
I don''t believe there is a "generic" way. However something
like this should
work:
#! /usr/bin/env ruby
require ''fox16''
include Fox
class ExampleApp < FXMainWindow
def initialize(app)
super(app, "Example Application", :opts => DECOR_ALL, :width
=> 800,
:height => 600)
@registry = app.reg()
@split = []
@split[0] = @registry.readIntEntry("splitter", "split0",
124)
@split[1] = @registry.readIntEntry("splitter", "split1",
674)
end
def create
draw_gui
super
show(PLACEMENT_SCREEN)
end
def draw_gui
split = FXSplitter.new(self, LAYOUT_FILL | SPLITTER_NORMAL |
SPLITTER_TRACKING)
b1 = FXButton.new(split, "Button 1", :opts => BUTTON_NORMAL |
LAYOUT_FILL)
b2 = FXButton.new(split, "Button 2", :opts => BUTTON_NORMAL |
LAYOUT_FILL)
split.connect(SEL_COMMAND) do
@registry.writeIntEntry("splitter", "split0",
split.getSplit(0))
@registry.writeIntEntry("splitter", "split1",
split.getSplit(0))
end
@split.each_index do |i|
split.setSplit(i, @split[i])
end
end
end
if __FILE__ == $0
app = FXApp.new("example", "example")
app.init(ARGV)
win = ExampleApp.new(app)
app.create
app.run
end
On Mon, Jul 19, 2010 at 2:06 PM, Ralph Shnelvar <ralphs at dos32.com>
wrote:
> Is there a generic way of recording the splitter position(s) and throwing
> them at the registry?
>
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
--
If you are not the intended recipient, you are hereby notified
that any dissemination, distribution, copying or other use of
this communication is strictly prohibited. If you have
received this communication in error, please notify us
immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20100719/5b6a6160/attachment.html>